﻿<template>
    <full-screen-dialog
        :title="titleMap[mode]"
        v-model="visible"
        :width="900"
        destroy-on-close
        :close-on-click-modal="false"
        @closed="$emit('closed')"
    >
        <el-form
            :model="entityObj"
            :rules="rules"
            ref="dialogForm"
            label-width="100px"
        >

            <el-row>
                <el-col :span="8">
                    <el-form-item label-width="120px" label="发布时间：">
                        <span style=""> {{ entityObj.createTime }}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label-width="120px" label="消息来源：">
                        <span style=""> {{entityObj.logSourceDesc}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label-width="120px" label="消息类型：">
                        <span style="">  {{entityObj.logTypeDesc}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
           
            <el-row>
                <el-col :span="24">
                    <el-form-item label-width="120px" label="消息标题：">
                       <span style="font-weight: bold;color:red"> {{ entityObj.logTitle }}</span>
                      
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <el-form-item label-width="120px" label="消息内容：">
                        <span style="font-weight: bold;color:red"> {{ entityObj.logBody }}</span>
                      
                    </el-form-item>
                </el-col>
            </el-row>
          
           
            <el-row>
                <el-col :span="24">
                    <el-form-item label-width="120px" label="操作员：">
                       {{entityObj.updateName}}
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <el-form-item label-width="120px" label="操作时间：">
                       {{entityObj.updateTime=="0001-01-01 00:00:00"?"":entityObj.updateTime}}
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <el-form-item label-width="120px" label="消息状态：">
                        <!--业务操作-->
                        <div v-if="entityObj.logType==0">
                            <el-tag type="danger" effect="plain"  v-if="entityObj.status==0">未处理</el-tag>
                            <el-tag type="success" effect="plain" v-if="entityObj.status==1">已处理</el-tag>
                        </div>
                         <!--消息通知-->
                         <div v-if="entityObj.logType==1">
                            <el-tag type="danger" effect="plain"  v-if="entityObj.status==0">未读</el-tag>
                            <el-tag type="success" effect="plain" v-if="entityObj.status==1">已读</el-tag>
                        </div>
                        
                    </el-form-item>
                </el-col>
            </el-row>
           
        </el-form>
        <template #footer>
            <el-button @click="visible = false">取 消</el-button>
            <el-button type="primary" v-if="entityObj.status==0" :loading="isSaveing"  @click="opStatus()">已处理</el-button>
        </template>
      
       


    </full-screen-dialog>
</template>

<script>
import tool from "@/utils/tool";
export default {
    emits: ["success", "closed"],
    data() {
        return {
            mode: "Add",
            titleMap: {
                Show: "消息通知详情",
            },
            entityObj: {
                remarks:"",
                afterOrderItems:[]
            },
            visible: false,
            isSaveing: false,
            needSaveFlag: false,
            //验证规则
            rules: {
               
            },
            
          
        };
    },
   
    watch: {
            
	},
    methods: {
        //显示=
        open(mode = "Add") {
            this.mode = mode;
            this.visible = true;
            
            return this;
        },
     
      
        //表单注入数据
        async setData(data) {
            console.log(" data",data);
            this.entityObj=data
            
        },
         //操作状态
         async opStatus(){
            try {
                var returnValue = await this.$API.auth.PostProcessApi.post("notice/status",{ 
                        logId: this.entityObj.logId
                    });
                    if (returnValue.status == 200) {
                        this.$message.success("操作成功");
                        this.visible=false;
                        this.$emit("fatherMethod");
                    } else {
                        this.$message.error("操作失败:" + returnValue.msg);
                    }
            } catch (error) {
                this.loading = false;
                this.isSaveing = false;
                return false;
            }
        },
        async initOptions() {
           
        },
       
    },
    async mounted() {
        await this.initOptions();
        
       
        
    },
};
</script>

